﻿using System;
using System.Collections.Generic;
using System.Text;
using Sinacor.Infra.Service.Security;
using System.ServiceModel;
using Sinacor.Service.Infra.AuthorizationService.Service.DataContract.Response;
using Sinacor.Infra.Service.Security.Services;

namespace Sinacor.Service.Infra.AuthorizationService.Service.ServiceImplementation
{
	[SinacorServiceBehavior]
	public class Menu : ServiceContract.IMenu
	{
		public List<CompanyResponse> RetrieveCompanies()
		{
            BusinessLogic.Menu blMenu = new BusinessLogic.Menu();
			return Translator.TranslateBetweenCompany.ToDataContractList(blMenu.RetrieveCompanies());
		}

		public List<ModuleResponse> RetrieveModules(int companyId)
		{
			BusinessLogic.Menu blMenu = new BusinessLogic.Menu();
			return Translator.TranslateBetweenModule.ToDataContractList(blMenu.RetrieveModules(companyId));
		}

		public bool CheckRolePermission(string role, string moduleId, int companyId)
		{
			BusinessLogic.Menu blMenu = new BusinessLogic.Menu();
			return blMenu.CheckRolePermission(role, moduleId, companyId);
		}
	}
}